package com.ptu.spzx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ptu.spzx.domain.Question.po.QuestionKnowledge;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author YT
 * @since 2024-01-28
 */
@Mapper
public interface QuestionKnowledgeMapper extends BaseMapper<QuestionKnowledge> {
    @Delete("DELETE FROM question_knowledge WHERE question_id=#{questionId} ")
    void deleteKnowledge(Long questionId);

    @Select("SELECT question_id FROM question_knowledge WHERE knowledge_id=#{knowledge}")
    List<Long> selectByKnowledge(Long knowledge);

    @Select("SELECT knowledge_id FROM question_knowledge WHERE question_id=#{questionId}")
    List<Long> selectByQuestion(Long questionId);
}
